from appium.webdriver.common.appiumby import AppiumBy

from appium_xueqiu.page_object.base_page.base_page import BasePage


class ComprehensivePage(BasePage):

    def get_stock_price(self, stock_name):
        stock_price = self.do_find((AppiumBy.XPATH, f"//*[@text='{stock_name}']/../../..//*[@resource-id='com.xueqiu.android:id/current_price']")).text

        return float(stock_price)
